﻿using System;
using fastCSharp;

namespace diantou.web.onlineJudge
{
    /// <summary>
    /// 过期问题列表
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class expiredProblemList : problemList<expiredProblemList>
    {
        /// <summary>
        /// 初始化问题列表
        /// </summary>
        /// <param name="page">分页号</param>
        /// <param name="sort">排序类型</param>
        /// <param name="isAsc">是否升序</param>
        /// <returns>是否成功</returns>
        private bool loadView(int page, diantou.dataAccess.problem.sort sort, bool isAsc)
        {
            group = new dataAccess.problemGroup.userProblemGroup { Group = diantou.dataAccess.problemGroup.ExpiredGroup, UserId = currentUserId };
            diantou.dataAccess.problem[] problems = diantou.dataAccess.clientCache.Problem.Get(diantou.dataAccess.tcpCall.problem.getExpiredIds(sort, isAsc, pageInfo.Size = 20, pageInfo.Page = page, currentUserId, out pageInfo.Count));
            this.problems = problems.getArray(value => new userProblem { Problem = value, User = currentUser });
            if (requestHeader.IsSearchEngine) pageInfo.Path = diantou.dataModel.path.pub.Default.OnlineJudgeExpiredProblemPath;
            return true;
        }
    }
}
